package com.wlscale.roadsystem.modular.setting;

import android.view.View;
import android.widget.LinearLayout;

import com.wlscale.roadsystem.R;
import com.wlscale.roadsystem.base.LZBaseActivity;
import com.wlscale.roadsystem.modular.setting.syscalibration.SystemCalibrationActivity;
import com.wlscale.roadsystem.wiget.ChoiceTimeAlertDialog;

/**
 * 菜单
 */
public class SettinActivity extends LZBaseActivity implements View.OnClickListener {
    /**
     * 参数设定
     */
    private LinearLayout btn_setting_parameter;
    /**
     * 系统校准
     */
    private LinearLayout btn_sys_calibration;
    /**
     * 停车数据管理
     */
    private LinearLayout btn_data_manage;
    /**
     * 清除数据
     */
    private LinearLayout btn_clear_data;
    /**
     * 出厂调教
     */
    private LinearLayout btn_factory_training;
    /**
     * 校验参数
     */
    private LinearLayout btn_calibration_parameter;
    /**
     * 用户管理
     */
    private LinearLayout btn_user_manage;
    /**
     * 轴型校准
     */
    private LinearLayout btn_axis;
    /**
     * 推出设置
     */
    private LinearLayout btn_close;

    @Override
    public void initlayoutResID() {
        setContentView(R.layout.activity_ctrl_set);
    }

    @Override
    public void initBundle() {

    }

    @Override
    public void initView() {
        btn_setting_parameter = findViewById(R.id.btn_setting_parameter);
        btn_sys_calibration = findViewById(R.id.btn_sys_calibration);
        btn_data_manage = findViewById(R.id.btn_data_manage);
        btn_clear_data = findViewById(R.id.btn_clear_data);
        btn_factory_training = findViewById(R.id.btn_factory_training);
        btn_calibration_parameter = findViewById(R.id.btn_calibration_parameter);
        btn_user_manage = findViewById(R.id.btn_user_manage);
        btn_axis = findViewById(R.id.btn_axis);
        btn_close = findViewById(R.id.btn_close);
        btn_setting_parameter.setOnClickListener(this);
        btn_sys_calibration.setOnClickListener(this);
        btn_data_manage.setOnClickListener(this);
        btn_clear_data.setOnClickListener(this);
        btn_factory_training.setOnClickListener(this);
        btn_calibration_parameter.setOnClickListener(this);
        btn_user_manage.setOnClickListener(this);
        btn_axis.setOnClickListener(this);
        btn_close.setOnClickListener(this);
    }

    @Override
    public void initHeader() {

    }

    @Override
    public void initLoadingView() {

    }

    @Override
    public void initData() {

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_setting_parameter:
                goActivity(SettingParameterActivity.class);
                break;
            case R.id.btn_sys_calibration:
                goActivity(SystemCalibrationActivity.class);
                break;
            case R.id.btn_data_manage:
                goActivity(ParkingDataManagementActivity.class);
                break;
            case R.id.btn_clear_data:
                clearData();
                break;
            case R.id.btn_factory_training:
                goActivity(ParameterSettingActivtiy.class);
                break;
            case R.id.btn_calibration_parameter:
                goActivity(CalibrationParameterActivity.class);
                break;
            case R.id.btn_user_manage:
                goActivity(UserManagementActivity.class);
                break;
            case R.id.btn_axis:
                goActivity(AxisNumberCorrectActivity.class);
                break;
            case R.id.btn_close:
                finishActivity();
                break;
        }
    }
    private void clearData(){
        showChoiceTimeAlert("重整记录导出", "请选择需要清除的日期：", "清除", "取消", new ChoiceTimeAlertDialog.OnClickLister() {
            @Override
            public void onClickLister(String startTime, String endTime) {

            }
        });
    }
}
